import { getData, postData, deleteData } from '../../../untils/request';

// 获取文章
export async function getArticle(uuid) {
    const article = await getData(`/article/getArticleByUuid/${uuid}`);
    return article;
}

// 判断是否关注
export async function isConcerned(userId, concernedId) {
    const result = await getData(`/concerned/isConcerned/${userId}/${concernedId}`);
    return result;
}

// 关注
export async function concernedOther(data) {
    const result = await postData(`/concerned/concerned`, data);
    return result;
}

// 取消关注
export async function disConcernedOther(userId, concernedId) {
    const result = await deleteData(`/concerned/disConcerned/${userId}/${concernedId}`);
    return result;
}

// 找到文章的所有评论
export async function getAllComments(id) {
    const result = await getData(`/comment/find/${id}`);
    return result;
}

// 发布评论
export async function sendComment(comment) {
    const result = await postData('/comment/add', comment);
    return result;
}

// 举报文章
export async function reportArticle(data) {
  const result = await postData('/report/article', data);
  return result;
}
